package com.xbao.dao;

import com.xbao.model.StuOrgRel;
import com.xbao.model.StuOrgRelExample;
import java.util.List;

import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
@Mapper
public interface StuOrgRelMapper {
    @SelectProvider(type=StuOrgRelSqlProvider.class, method="countByExample")
    int countByExample(StuOrgRelExample example);

    @DeleteProvider(type=StuOrgRelSqlProvider.class, method="deleteByExample")
    int deleteByExample(StuOrgRelExample example);

    @Delete({
        "delete from stu_org_rel",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into stu_org_rel (id, sid, oid)",
        "values (#{id,jdbcType=BIGINT}, #{sid,jdbcType=BIGINT}, #{oid,jdbcType=BIGINT})"
    })
    int insert(StuOrgRel record);

    @InsertProvider(type=StuOrgRelSqlProvider.class, method="insertSelective")
    int insertSelective(StuOrgRel record);

    @SelectProvider(type=StuOrgRelSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="sid", property="sid", jdbcType=JdbcType.BIGINT),
        @Result(column="oid", property="oid", jdbcType=JdbcType.BIGINT)
    })
    List<StuOrgRel> selectByExample(StuOrgRelExample example);

    @Select({
        "select",
        "id, sid, oid",
        "from stu_org_rel",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="sid", property="sid", jdbcType=JdbcType.BIGINT),
        @Result(column="oid", property="oid", jdbcType=JdbcType.BIGINT)
    })
    StuOrgRel selectByPrimaryKey(Long id);

    @UpdateProvider(type=StuOrgRelSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") StuOrgRel record, @Param("example") StuOrgRelExample example);

    @UpdateProvider(type=StuOrgRelSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") StuOrgRel record, @Param("example") StuOrgRelExample example);

    @UpdateProvider(type=StuOrgRelSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(StuOrgRel record);

    @Update({
        "update stu_org_rel",
        "set sid = #{sid,jdbcType=BIGINT},",
          "oid = #{oid,jdbcType=BIGINT}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(StuOrgRel record);
}